package com.soos.plugin.ds.spring.boot.autoconfigure;

import com.soos.plugin.ds.spring.boot.annotations.DS;
import com.soos.plugin.ds.spring.boot.enums.DBEnum;

public class DBInfo {

    /**
     * 数据库的配置main,others
     */
    private DBEnum dbEnum;

    /**
     * 第几个数据库信息
     */
    private int index;

    public DBInfo() {
    }

    public DBInfo(DS ds) {
        this.dbEnum = ds.value();
        this.index = ds.index();
    }

    public DBInfo(DBEnum dbEnum, int index) {
        this.dbEnum = dbEnum;
        this.index = index;
    }

    public DBEnum getDbEnum() {
        return dbEnum;
    }

    public void setDbEnum(DBEnum dbEnum) {
        this.dbEnum = dbEnum;
    }

    public int getIndex() {
        return index;
    }

    public void setIndex(int index) {
        this.index = index;
    }

    @Override
    public String toString() {
        return "DBInfo{" +
                "dbEnum=" + dbEnum +
                ", index=" + index +
                '}';
    }
}
